Intermediate language (IL) code, such as MSIL (Microsoft Intermediate Language, produced by Microsoft Corporation, Redmond, Washington) or Java byte codes, is produced by a compiler at development time and then converted (e.g., JIT'ed or just-in-time translated) to machine code on a client machine. Conventionally, for each processor or platform supported, a different JIT compiler (referred to herein as a JIT) must be developed. Additionally, one of the typical steps performed by the client machine at run time is to verify the IL (or byte code stream) as part of the JIT process.
A JIT performs just-in-time translation of abstract byte codes to machine code under very tight time constraints that a normal compiler would not deal with. Conventionally, the prior art shows that a JIT will perform several passes (in different components) to produce optimized machine code that has been verified as safe for the target architecture. This invention improves on the prior art by performing both verification and optimizations in the JIT's reader, simultaneously, so that the resulting internal representation also contains an embedded form of analysis typically used for many traditional compiler optimizations. Additionally, this machine independent component can be easily re-targeted for many different processors. Thus, the invention provides a method to combine many functions in one pass which is a significant improvement to the prior art in an area (just-in-time translation) where time is critical.